// components/exhibition-item/exhibition-item.js
import '../../utils/dateFormat'
const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    exhibitions: Array
  },

  /**
   * 组件的初始数据
   */
  data: {
    imgUrl: app.globalData.imgUrl
  },

  /**
   * 组件的方法列表
   */
  methods: {
    showExhitonList: function (e) {
      var now = new Date().Format("yyyy-MM-dd")
      console.log(now)
      var index = e.currentTarget.dataset.item;
      console.log(index)
      now >= index.exhibBegin && now <= index.exhibEnd ? wx.navigateTo({
        url: "/pages/exhibition/exhibition?exhibitionId=" + index.exhibCode
      }) : wx.showToast({
        title: "暂不在开放时间",
        icon: "none"
      });
    }
  }
})
